using System;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections.Generic;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;

[assembly: WebResource("Ajax.Logging.Scripts.SysDebugListener.js", "text/javascript")]


namespace Ajax.Logging
{
    [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class SysDebugListener : BaseListener
    {
        [Browsable(false)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override string CreateScript
        {
            [DebuggerStepThrough()]
            get
            {
                string script = string.Format(System.Globalization.CultureInfo.InvariantCulture, "Ajax.Logging.ExceptionManager.getInstance().addListener(new {0}());", this.GetType().FullName);

                return script;
            }
        }

        [Browsable(false)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override IEnumerable<ScriptReference> ScriptReferences
        {
            [DebuggerStepThrough()]
            get
            {
                return new ScriptReference[] { new ScriptReference(Owner.Page.ClientScript.GetWebResourceUrl(this.GetType(), "Ajax.Logging.Scripts.SysDebugListener.js")) };
            }
        }
    }
}
